# -*- coding:utf-8 -*-

from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from aircos.tools import views_tools
from django.http import HttpResponseNotFound,HttpResponseServerError


def get_count(request):

    data={
        "is_exits":True,
        "sku_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "total_count":100,
        "available_count":20,
        "lock_count":30,
        "warehouse":[{
            "id":"123345",
            "name":"北京仓库",
            "address":"朝阳区",
            "real_count":50,
            "available_count":10,
            "lock_count":12
        },
        {
            "id":"123345",
            "name":"成都仓库",
            "address":"朝阳区",
            "real_count":50,
            "available_count":10,
            "lock_count":12
        }]
}
    print "get_count"
    return views_tools.success_json(data)

@csrf_exempt
def lock_count(request):

    data={
        "is_success": True
    }
    print "lock_count"
    return views_tools.success_json(data)
